package com.astrob.tspant;

import java.io.Serializable;

//如果是经纬度，则* 1E6
public class PointE implements Serializable {

    private static final long serialVersionUID = -870520749171665438L;

    public long x;
    public long y;

    public PointE() {
    }

    public PointE(long x, long y) {
        this.x = x;
        this.y = y;
    }

    public PointE(PointE src) {
        this.x = src.x;
        this.y = src.y;
    }

    /**
     * Set the point's x and y coordinates
     */
    public void set(long x, long y) {
        this.x = x;
        this.y = y;
    }


    /**
     * Returns true if the point's coordinates equal (x,y)
     */
    public final boolean equals(long x, long y) {
        return this.x == x && this.y == y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PointE point = (PointE) o;

        if (x != point.x) return false;
        if (y != point.y) return false;

        return true;
    }

}
